{% extends 'layout.html' %}
{% load static %}
{% load permission %}
{% load color %}


{% block content %}

    {% include 'include/search_group.html' %}

    <div class="clearfix" style="margin-bottom: 5px;">
        <div class="right">
            <form class="form-inline" method="get">
                <div class="form-group">
                    <input name="keyword" type="text" class="form-control" placeholder="请输入关键字" value="{{ keyword }}">
                </div>
                <button type="submit" class="btn btn-default">
                    <span class="glyphicon glyphicon-search"></span>
                </button>
            </form>
        </div>
    </div>

    <table class="table table-bordered">
        <thead>
        <tr>
            <th>ID</th>
            <th>类型</th>
            <th>金额</th>
            <th>订单号</th>
            <th>时间</th>
            <th>其他</th>
        </tr>
        </thead>
        <tbody>
        {% for row in pager.queryset %}
            <tr>
                <td>{{ row.id }}</td>
                <td>
                    <span class="btn btn-xs btn-{{ row.charge_type|color }}">{{ row.get_charge_type_display }}</span>
                </td>
                <td>
                    {{ row.amount }}
                </td>
                <td>
                    {% if row.order_oid %}
                        {{ row.order_oid }}
                    {% else %}
                        -
                    {% endif %}
                </td>
                <td>{{ row.create_datetime|date:"Y-m-d H:i:s" }}</td>
                <td>
                    {% if row.memo %}
                        {{ row.memo }}
                    {% else %}
                        -
                    {% endif %}
                </td>
            </tr>
        {% endfor %}

        </tbody>
    </table>

    <ul class="pagination">
        {{ pager.html }}
    </ul>


{% endblock %}
